<%@ page language="java" import="java.util.*,Sj.Info" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'table.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
	.table{
	width: 80%;
    border-collapse: collapse;
    margin: auto;
	}
	.table td{
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: medium;
	}
	</style>

  </head>
  
  <body>
<%
Info info1=new Info("王二","贵州",01,85);
Info info2=new Info("张三","广东",02,65);
Info info3=new Info("李四","江西",03,95);
Info info4=new Info("麻子","江苏",04,75);
ArrayList<Info> list=new ArrayList<Info>();
list.add(info1);
list.add(info2);
list.add(info3);
list.add(info4);
%>
<table class="table" border="1" cellpadding="0" cellspacing="0">
<tr><td>姓名</td><td>籍贯</td><td>学号</td><td>成绩</td></tr>
<%
for (Info info : list){
%>
<tr><td><%=info.getName() %></td><td><%=info.getJg() %></td><td><%=info.getXh() %></td><td><%=info.getCj() %></td></tr>
<% 
}
%>
</table>
  </body>
</html>
